// 接口实现基本用法
package main

import (
	"fmt"
)

type User struct {
	id   int
	name string
}

type Sayable interface {
	sayHello()
}

func (u User) sayHello() {
	fmt.Println("Hello! My name is", u.name)
}

func main() {
	var u Sayable = User{id: 1, name: "zxy"}
	u.sayHello()
}
